package com.fu.core.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;

/**
 * @author 付龙江
 * @date 2022/1/28 15:26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "goods_vo")
public class GoodsEsVo implements Serializable {
    @Id
    @Field(type = FieldType.Long)
    private Integer id;
    @Field(type = FieldType.Text)
    private String goodsName;
    @Field(type = FieldType.Text)
    private String goodsKeyWord;
    @Field(type = FieldType.Text)
    private String typeName;
    @Field(type = FieldType.Text)
    private String goodsMainImg;
    @Field(type = FieldType.Date)
    private Timestamp goodsStartShelf;
    @Field(type = FieldType.Double)
    private Double goodsStartPrice;
    @Field(type = FieldType.Text)
    private String goodsUnit;
    @Field(type = FieldType.Integer)
    private Integer salesNum;
    @Field(type = FieldType.Double)
    private Double evaluate;

    @Field(type = FieldType.Integer)
    private Integer goodsSeckill;

    /**
     * 往数据库中存储年月日
     */
    @Field(type = FieldType.Date)
    private Date goodsSeckillDay;

    /**
     * 时分秒  09:00:00  12:00:00  15:00:00  18:00:00
     */
    @Field(type = FieldType.Text)
    private String goodsSeckillDayDetails;

    /**
     * 秒杀价格
     */
    @Field(type = FieldType.Double)
    private Double seckillPrice;

    /**
     * 秒杀数量
     */
    @Field(type = FieldType.Integer)
    private Integer seckillNum;

}
